package com.woniu.liuzhougov.authorityControl.controller;

import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author zhuxinpan
 * @version 1.0
 * @className ExceptionHandleController
 * @description 异常捕获处理
 * @date 2019/5/5 11:26
 */
@ControllerAdvice
public class ExceptionHandleController {

    @ExceptionHandler(UnauthorizedException.class)
    public String handleShiroException(Exception ex) {
        return "403";
    }

    @ExceptionHandler(AuthorizationException.class)
    public String AuthorizationException(Exception ex) {
        return "403";
    }
}
